Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #159 #160

Merged
merged 2 commits into from
Feb 9, 2024
Merged

Fix issue #159 #160

merged 2 commits into from
Feb 9, 2024

Conversation

lohedges
Copy link
Contributor

@lohedges lohedges commented Feb 9, 2024

This PR closes #159 by ensuring that vector components that are sufficiently close to zero following a reduction are set to exactly zero. This solves the issue of conversion to OpenMM, which requires that the first vector lies exactly on the x-axis and the second is exactly in the x-y plane. Non-zero values generated by our code seem to be on the order of 1e-16, so we could probably make the tolerance smaller if needed. (The OpenMM Python API uses 1e-6 as the small value.)

An alternative approach to this would be to leave the TrinclinicBox class untouched and simply zero the values when setting the box vectors in the Sire to OpenMM code. Let me know if you'd prefer that approach, since this issue seems to be (at present) OpenMM specific due to the way they check for reduced form.

I've cancelled the CI since it's been tested locally via some problematic somd1 inputs. Feel free to consume into one of the other PRs if you're happy.

Copy link
Contributor

@chryswoods chryswoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - I'll merge all the PRs together with the addition of 3.10 to the Mac build.

@chryswoods chryswoods merged commit a74c91b into devel Feb 9, 2024
0 of 5 checks passed
@chryswoods chryswoods deleted the fix_159 branch February 9, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Reduced triclinic boxes can't be used with OpenMM C++ API
2 participants